N,M=map(int,input().split())

result=[0,1e9,-1]

for i in range(1,N+1):
    nums=list(map(int,input().split()))
    s=sum(nums)
    result[0]+=s
    s=-s+nums[0]
    if s>result[2]:
        result[2]=s
        result[1]=i

for item in result:
    print(item,end=" ")
print("")

